package fx.protocol;

import javafx.scene.Node;
import javafx.scene.layout.AnchorPane;

public interface Anchor {
    default void anchor(Double right, Double bottom, Double top, Double left){
        if (right != null) {
            AnchorPane.setRightAnchor(anchorEle(), right);
        }
        if (bottom != null) {
            AnchorPane.setBottomAnchor(anchorEle(), bottom);
        }
        if (top != null) {
            AnchorPane.setTopAnchor(anchorEle(), top);
        }
        if (left != null) {
            AnchorPane.setLeftAnchor(anchorEle(), left);
        }
    }

    Node anchorEle();
}
